unit uDMOddzialy;

interface

uses
  SysUtils, Classes, uADStanIntf, uADStanOption, uADStanError, uADGUIxIntf, uADPhysIntf,
  uADStanDef, uADStanPool, uADPhysManager, DB, uADCompClient, uADStanParam, uADDatSManager,
  uADDAptIntf, uADStanAsync, uADDAptManager, uADCompDataSet;

type
  TDMOddzialy = class(TDataModule)
    ADQOddzialy: TADQuery;
    ADQDodajOddzial: TADQuery;
    ADQUsunOddzialy: TADQuery;
    ADQidNazwyOdzialu: TADQuery;
    ADQZapiszOddzialy: TADQuery;
    ADQidAdresXMLOddzialu: TADQuery;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }ADConnection: TADConnection;
    ADTransaction: TADTransaction;
  public
    { Public declarations }
    constructor Create(Connection: TADConnection; Transaction: TADTransaction ; AOwner: TComponent);
  end;

//var
//  DMOddzialy: TDMOddzialy;

implementation

{$R *.dfm}

constructor TDMOddzialy.Create(Connection: TADConnection; Transaction: TADTransaction ; AOwner: TComponent);
begin
  inherited Create(AOwner);
  ADConnection := Connection;
  ADTransaction := Transaction;
  Name := '';
end;

procedure TDMOddzialy.DataModuleCreate(Sender: TObject);
var
  i : integer;
begin
  for i:=0 to Self.ComponentCount-1 do
  begin
    if Self.Components[i] is TADQuery then
    begin
      (Self.Components[i] as TADQuery).Connection := ADConnection;
      (Self.Components[i] as TADQuery).Transaction  := ADTransaction;
    end;
  end;
end;

end.
